#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSettings>
#include <QTcpServer>
#include <QTcpSocket>
#include <QFile>
#include <QDebug>
#include <QNetworkInterface>
#include <QFileDialog>
#include <QIntValidator>
#include <QMessageBox>
#include <QMimeDatabase>
#include <QDateTime>
#include <QMetaEnum>
#include <QJsonObject>
#include <QJsonDocument>
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QMimeData>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QSettings settings;
    QString IP, path;
    QTcpServer *tcpServer;
    QTcpSocket *tcpSocket;
    int state;
    QFile file;
    qint64 length, port_local;
    QString BS(long b);
    void upload(QString filepath);
    double lastModified = 0;
    void dragEnterEvent(QDragEnterEvent*);
    void dropEvent(QDropEvent*);

private slots:
    void newConnect();
    void readyRead();

};

#endif // MAINWINDOW_H